//
//  XPPXcodeMenuItem.h
//  XPPXcodePlugin
//
//  Created by yoyokko on 10-4-21.
//  Copyright 2010 yoyokko@gmail.com. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class PBXTarget;

@protocol XPPXcodeMenuItemProtocol
// name of the menu item
- (NSString*)title;

// the action to perform
- (SEL)actionSelector;

// what menu to insert the item into
- (NSMenu*)insertionMenu;

// where we want the menu item inserted
- (int)insertionIndex;

// the hot key
- (NSString*)keyEquivalent;

// the depth of the item as a hierarchical menu item
// eg 0 is in the root menu, 2 is in the Root:Debug:Attach menu
- (int)depth;

// method is called when the item is inserted
- (void)wasInserted:(NSMenuItem*)item;

// allow the icon to being added to make the menus easier to find
- (BOOL)allowXPPMenuIcon;
@end


@interface XPPXcodeMenuItem : NSObject <XPPXcodeMenuItemProtocol>
// the default action for menu items
- (void)action:(id)sender;

// returns the array of currently "selected files" in Xcode. This can be
// the front most text document, or a selection out of the browser window.
- (NSArray*)selectedPaths;

// Expand |path| based on |target| and |configuration|.
// If newPath is not absolute, expand kSrcRootPath and prepend it to newPath.
- (NSString *)pathByExpandingString:(NSString *)path
              forBuildConfiguration:(NSString *)configuration
                           ofTarget:(PBXTarget *)target;
@end
